<template>
<span class="listTop-wrapper">
  <button v-if="ctl=='Menu'" title="菜单分组" class="ui circular icon primary button mini" @click.prevent="clickCom"><i
      class="icon object group"></i></button>
  <a v-if="ctl=='cache_models'" title="显示所有缓存" class="ui circular icon primary button mini" target="_blank" :href="see_url">
      <i class="icon unhide"></i>
  </a>
  <!--<button v-if="ctl=='cache_models'" title="显示所有缓存" class="ui circular icon primary button mini" @click.prevent="clickCom"><i-->
      <!--class="icon unhide"></i></button>-->
  <button v-if="ctl=='cache_models'" title="生成url文件" class="ui circular icon primary button mini" @click.prevent="clickCom('cache_models_pro_url')"><i
      class="icon file"></i></button>
</span>
</template>

<script type="text/ecmascript-6">
  import tool from 'src/util/tool';
  import util from '_util/index';
  import RP from '_common/show_com';

  export default {
    data() {
      return {
          see_url:''
      }
    },
    methods: {
      clickCom(flag) {
        switch (this.ctl) {
          case 'cache_models':
            if(flag=='cache_models_pro_url') {
              let url = tool.getApi(this, 'Tool', 'proupmemUrls');
              util.http.SR(this, url,{}, '生成文件成功!', ()=> {
              });
            }
//            else
//            RP.showCache(this);
            break;
          case 'Menu':
            util.jump(this, '/page/menu_group')
            break;
          default:

        }
        // this.$emit()
      }
    },
    watch: {
      ctl: function (val, old) {
        if (val != old) {
        }
      }
    },
    computed: {
      ctl() {
        return this.$route.query.ctl;
      },
    },
    props: [],
    created() {
      this.see_url=tool.getApi(this, 'Show', 'showCache');
    },
    mounted() {
    }
  };
</script>
